﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="RecipeDetail.aspx.vb" Inherits="mybaconrecipe.RecipeDetail" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div id="lhsPaneWide">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
    <asp:ListView ID="lst_RecipeFullDetail" runat="server" 
        DataSourceID="RecFullDetailSqlDataSource">

        <AlternatingItemTemplate>
                <div class="recDetail_RecNameContainer">
                    <h1><asp:Label ID="Label1" runat="server" Text='<%# Eval("REC_NAME") %>' /></h1>
                </div>
        <div class="recDetail_RecipeContainer">
                <div class="recDetail_RecInfoRow1">
                    <div class="recDetail_By">By <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & DataBinder.Eval(Container.DataItem, "USER_FNAME") %> <%# DataBinder.Eval(Container.DataItem, "USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a></div>
                    <div class="recDetail_AddedID">Added <asp:Label ID="Label3" runat="server" Text='<%# Eval("REC_DATE") %>' /> | Recipe #<asp:Label ID="Label4" runat="server" Text='<%# Eval("REC_ID") %>' /></div>
                    <div class="recDetail_ServedAs">Served as <a href='<%# "RecipeList.aspx?Type=" & DataBinder.Eval(Container.DataItem, "TYPE_TYPE_ID") %>'><asp:Label ID="TYPE_IDLabel" runat="server" Text='<%# Eval("TYPE_DESC") %>' /></a></div>
                </div>
            </div>
        </AlternatingItemTemplate>

        <EditItemTemplate>
               <div class="recDetail_RecNameContainer">
                    <h1><asp:Label ID="Label1" runat="server" Text='<%# Eval("REC_NAME") %>' /></h1>
                </div>
        <div class="recDetail_RecipeContainer">
                <div class="recDetail_RecInfoRow1">
                    <div class="recDetail_By">By <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & DataBinder.Eval(Container.DataItem, "USER_FNAME") %> <%# DataBinder.Eval(Container.DataItem, "USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a></div>
                    <div class="recDetail_AddedID">Added <asp:Label ID="Label3" runat="server" Text='<%# Eval("REC_DATE") %>' /> | Recipe #<asp:Label ID="Label4" runat="server" Text='<%# Eval("REC_ID") %>' /></div>
                    <div class="recDetail_ServedAs">Served as <a href='<%# "RecipeList.aspx?Type=" & DataBinder.Eval(Container.DataItem, "TYPE_TYPE_ID") %>'><asp:Label ID="TYPE_IDLabel" runat="server" Text='<%# Eval("TYPE_DESC") %>' /></a></div>
                </div>
            </div>
        </EditItemTemplate>

        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>

        <InsertItemTemplate>
               <div class="recDetail_RecNameContainer">
                    <h1><asp:Label ID="Label1" runat="server" Text='<%# Eval("REC_NAME") %>' /></h1>
                </div>
        <div class="recDetail_RecipeContainer">
                <div class="recDetail_RecInfoRow1">
                    <div class="recDetail_By">By <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & DataBinder.Eval(Container.DataItem, "USER_FNAME") %> <%# DataBinder.Eval(Container.DataItem, "USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a></div>
                    <div class="recDetail_AddedID">Added <asp:Label ID="Label3" runat="server" Text='<%# Eval("REC_DATE") %>' /> | Recipe #<asp:Label ID="Label4" runat="server" Text='<%# Eval("REC_ID") %>' /></div>
                    <div class="recDetail_ServedAs">Served as <a href='<%# "RecipeList.aspx?Type=" & DataBinder.Eval(Container.DataItem, "TYPE_TYPE_ID") %>'><asp:Label ID="TYPE_IDLabel" runat="server" Text='<%# Eval("TYPE_DESC") %>' /></a></div>
                </div>
            </div>
        </InsertItemTemplate>

        <ItemTemplate>
               <div class="recDetail_RecNameContainer">
                    <h1><asp:Label ID="Label1" runat="server" Text='<%# Eval("REC_NAME") %>' /></h1>
                </div>
        <div class="recDetail_RecipeContainer">
                <div class="recDetail_RecInfoRow1">
                    <div class="recDetail_By">By <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & DataBinder.Eval(Container.DataItem, "USER_FNAME") %> <%# DataBinder.Eval(Container.DataItem, "USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a></div>
                    <div class="recDetail_AddedID">Added <asp:Label ID="Label3" runat="server" Text='<%# Eval("REC_DATE") %>' /> | Recipe #<asp:Label ID="Label4" runat="server" Text='<%# Eval("REC_ID") %>' /></div>
                    <div class="recDetail_ServedAs">Served as <a href='<%# "RecipeList.aspx?Type=" & DataBinder.Eval(Container.DataItem, "TYPE_TYPE_ID") %>'><asp:Label ID="TYPE_IDLabel" runat="server" Text='<%# Eval("TYPE_DESC") %>' /></a></div>
                </div>
            </div>
        </ItemTemplate>

        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>

        <SelectedItemTemplate>
               <div class="recDetail_RecNameContainer">
                    <h1><asp:Label ID="Label1" runat="server" Text='<%# Eval("REC_NAME") %>' /></h1>
                </div>
        <div class="recDetail_RecipeContainer">
                <div class="recDetail_RecInfoRow1">
                    <div class="recDetail_By">By <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & DataBinder.Eval(Container.DataItem, "USER_FNAME") %> <%# DataBinder.Eval(Container.DataItem, "USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a></div>
                    <div class="recDetail_AddedID">Added <asp:Label ID="Label3" runat="server" Text='<%# Eval("REC_DATE") %>' /> | Recipe #<asp:Label ID="Label4" runat="server" Text='<%# Eval("REC_ID") %>' /></div>
                    <div class="recDetail_ServedAs">Served as <a href='<%# "RecipeList.aspx?Type=" & DataBinder.Eval(Container.DataItem, "TYPE_TYPE_ID") %>'><asp:Label ID="TYPE_IDLabel" runat="server" Text='<%# Eval("TYPE_DESC") %>' /></a></div>
                </div>
            </div>
        </SelectedItemTemplate>
    </asp:ListView>

<!------ Tags Section ------>

    <div class="recDetailTagContainer">
    <p class="tagHeading">Tagged</p>
        <asp:ListView ID="lst_Tags" runat="server" 
            DataSourceID="RecDetailTagsSqlDataSource">
            <AlternatingItemTemplate>
                &nbsp;&nbsp;&nbsp;<a href='<%# "RecipeByTag.aspx?tag=" & DataBinder.Eval(Container.DataItem, "TAG") %>' title='<%# "View all recipies tagged " & DataBinder.Eval(Container.DataItem, "TAG") %>'>
                <asp:Label ID="TAGTextBox" runat="server" Text='<%# Eval("TAG") %>' /></a>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <a href='<%# "RecipeByTag.aspx?tag=" & DataBinder.Eval(Container.DataItem, "TAG") %>' title='<%# "View all recipies tagged " & DataBinder.Eval(Container.DataItem, "TAG") %>'>
                <asp:Label ID="TAGTextBox" runat="server" Text='<%# Eval("TAG") %>' /></a>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>This recipe has not been tagged</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <a href='<%# "RecipeByTag.aspx?tag=" & DataBinder.Eval(Container.DataItem, "TAG") %>' title='<%# "View all recipies tagged " & DataBinder.Eval(Container.DataItem, "TAG") %>'>
                <asp:Label ID="TAGTextBox" runat="server" Text='<%# Eval("TAG") %>' /></a>
            </InsertItemTemplate>
            <ItemTemplate>
                <a href='<%# "RecipeByTag.aspx?tag=" & DataBinder.Eval(Container.DataItem, "TAG") %>' title='<%# "View all recipies tagged " & DataBinder.Eval(Container.DataItem, "TAG") %>'>
                <asp:Label ID="TAGTextBox" runat="server" Text='<%# Eval("TAG") %>' /></a>
            </ItemTemplate>
            <LayoutTemplate>
                <div ID="itemPlaceholderContainer" runat="server" style="">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="">
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <a href='<%# "RecipeByTag.aspx?tag=" & DataBinder.Eval(Container.DataItem, "TAG") %>' title='<%# "View all recipies tagged " & DataBinder.Eval(Container.DataItem, "TAG") %>'>
                <asp:Label ID="TAGTextBox" runat="server" Text='<%# Eval("TAG") & " " %>' /></a>
            </SelectedItemTemplate>
        </asp:ListView>    
        <asp:SqlDataSource ID="RecDetailTagsSqlDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" 
            SelectCommand="SELECT * FROM [RECIPE_TAG_TAGNAME_VIEW] WHERE ([REC_ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="REC_ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>

   
<!------ Rating Section ------>

<div class="ratingContainer">
    <asp:Button ID="btn_ClickToRate" runat="server" Text="Rate This Recipe" CssClass="btn_FormSecondary" />&nbsp;
    <asp:Label ID="lblNotAllowedToRate" runat="server" Text="Label" CssClass="val_frmTable"><p>You are not allowed to rate this recipe because you have been blocked by an admin</p></asp:Label>
    <p><asp:Label ID="lblSuccessRating" runat="server" CssClass="val_frmTableGood" >Your Rating Has Been Submitted. Thank You!</asp:Label></p>
    <asp:PlaceHolder ID="plc_RateRecipe" runat="server">
       <asp:Rating CssClass="rtg_RatingControl" ID="rtg_RateRecipe" runat="server" EmptyStarCssClass="rtgEmpty" FilledStarCssClass="rtgCurrent" StarCssClass="rtgCurrent" WaitingStarCssClass="rtgReady">
       </asp:Rating> <asp:Button ID="btn_SubmitRating" runat="server" Text="Rate It!" CssClass="btn_Rating" />
    </asp:PlaceHolder>
</div>
   
<!------ About Recipe Section ------>

    <asp:ListView ID="ListView1" runat="server" 
        DataSourceID="RecFullDetailSqlDataSource">

        <AlternatingItemTemplate>
                <div class="recDetail_RecInfoRow2">
                    <div class="RecDetail_ImageContainer">
                        <asp:Image ID="recDetail_MainImage" runat="server" ImageUrl='<%# Eval("REC_IMAGE") %>' CssClass="RecDetailThumb" />
                    </div>
                    <div class="RecDetail_Row2RHS">
                        <asp:PlaceHolder ID="plc_CurrentRating" runat="server">
                            <div class="recDetail_Stars"><asp:Image ID="RecListStarsImage" runat="server" ImageUrl='<%# getBigBaconStars(Eval("REC_STARS"))%>' ToolTip='<%# "Rated: " & DataBinder.Eval(Container.DataItem, "REC_STARS") & " Bacon Strips" %>' /></div>
                            <div class="recDetail_TimesRated"><asp:Label ID="Label2" runat="server" Text='<%# "Based on " & Eval("REC_STARSTIMES") & " Ratings" %>' /></div>
                        </asp:PlaceHolder>
                        <div class="recDetail_Serves">Serves: <asp:Label ID="Label7" runat="server" Text='<%# Eval("REC_SERVES") %>' /></div>                        
                        <div class="recDetail_Time">Preparation Time: <asp:Label ID="Label6" runat="server" Text='<%# Eval("REC_TIME") %>' /> minutes</div>
                    </div>
                </div>
                <div class="recDetail_AboutContainer">
                    <h2>About This Recipe</h2>
                </div>
                 <div class="recDetail_Desc"><asp:Label ID="Label8" runat="server" Text='<%# Eval("REC_DESC") %>' /></div>
        </AlternatingItemTemplate>

        <EditItemTemplate>
                <div class="recDetail_RecInfoRow2">
                    <div class="RecDetail_ImageContainer">
                        <asp:Image ID="recDetail_MainImage" runat="server" ImageUrl='<%# Eval("REC_IMAGE") %>' CssClass="RecDetailThumb" />
                    </div>
                    <div class="RecDetail_Row2RHS">
                        <asp:PlaceHolder ID="plc_CurrentRating" runat="server">
                            <div class="recDetail_Stars"><asp:Image ID="RecListStarsImage" runat="server" ImageUrl='<%# getBigBaconStars(Eval("REC_STARS"))%>' ToolTip='<%# "Rated: " & DataBinder.Eval(Container.DataItem, "REC_STARS") & " Bacon Strips" %>' /></div>
                            <div class="recDetail_TimesRated"><asp:Label ID="Label2" runat="server" Text='<%# "Based on " & Eval("REC_STARSTIMES") & " Ratings" %>' /></div>
                        </asp:PlaceHolder>
                        <div class="recDetail_Serves">Serves: <asp:Label ID="Label7" runat="server" Text='<%# Eval("REC_SERVES") %>' /></div>                        
                        <div class="recDetail_Time">Preparation Time: <asp:Label ID="Label6" runat="server" Text='<%# Eval("REC_TIME") %>' /> minutes</div>
                    </div>
                </div>
                <div class="recDetail_AboutContainer">
                    <h2>About This Recipe</h2>
                </div>
                 <div class="recDetail_Desc"><asp:Label ID="Label8" runat="server" Text='<%# Eval("REC_DESC") %>' /></div>
        </EditItemTemplate>

        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>

        <InsertItemTemplate>
                 <div class="recDetail_RecInfoRow2">
                    <div class="RecDetail_ImageContainer">
                        <asp:Image ID="recDetail_MainImage" runat="server" ImageUrl='<%# Eval("REC_IMAGE") %>' CssClass="RecDetailThumb" />
                    </div>
                    <div class="RecDetail_Row2RHS">
                        <asp:PlaceHolder ID="plc_CurrentRating" runat="server">
                            <div class="recDetail_Stars"><asp:Image ID="RecListStarsImage" runat="server" ImageUrl='<%# getBigBaconStars(Eval("REC_STARS"))%>' ToolTip='<%# "Rated: " & DataBinder.Eval(Container.DataItem, "REC_STARS") & " Bacon Strips" %>' /></div>
                            <div class="recDetail_TimesRated"><asp:Label ID="Label2" runat="server" Text='<%# "Based on " & Eval("REC_STARSTIMES") & " Ratings" %>' /></div>
                        </asp:PlaceHolder>
                        <div class="recDetail_Serves">Serves: <asp:Label ID="Label7" runat="server" Text='<%# Eval("REC_SERVES") %>' /></div>                        
                        <div class="recDetail_Time">Preparation Time: <asp:Label ID="Label6" runat="server" Text='<%# Eval("REC_TIME") %>' /> minutes</div>
                    </div>
                </div>
                <div class="recDetail_AboutContainer">
                    <h2>About This Recipe</h2>
                </div>
                 <div class="recDetail_Desc"><asp:Label ID="Label8" runat="server" Text='<%# Eval("REC_DESC") %>' /></div>
        </InsertItemTemplate>

        <ItemTemplate>
                <div class="recDetail_RecInfoRow2">
                    <div class="RecDetail_ImageContainer">
                        <asp:Image ID="recDetail_MainImage" runat="server" ImageUrl='<%# Eval("REC_IMAGE") %>' CssClass="RecDetailThumb" />
                    </div>
                    <div class="RecDetail_Row2RHS">
                        <asp:PlaceHolder ID="plc_CurrentRating" runat="server">
                            <div class="recDetail_Stars"><asp:Image ID="RecListStarsImage" runat="server" ImageUrl='<%# getBigBaconStars(Eval("REC_STARS"))%>' ToolTip='<%# "Rated: " & DataBinder.Eval(Container.DataItem, "REC_STARS") & " Bacon Strips" %>' /></div>
                            <div class="recDetail_TimesRated"><asp:Label ID="Label2" runat="server" Text='<%# "Based on " & Eval("REC_STARSTIMES") & " Ratings" %>' /></div>
                        </asp:PlaceHolder>
                        <div class="recDetail_Serves">Serves: <asp:Label ID="Label7" runat="server" Text='<%# Eval("REC_SERVES") %>' /></div>                        
                        <div class="recDetail_Time">Preparation Time: <asp:Label ID="Label6" runat="server" Text='<%# Eval("REC_TIME") %>' /> minutes</div>
                    </div>
                </div>
                <div class="recDetail_AboutContainer">
                    <h2>About This Recipe</h2>
                </div>
                 <div class="recDetail_Desc"><asp:Label ID="Label8" runat="server" Text='<%# Eval("REC_DESC") %>' /></div>
        </ItemTemplate>

        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>

        <SelectedItemTemplate>
                <div class="recDetail_RecInfoRow2">
                    <div class="RecDetail_ImageContainer">
                        <asp:Image ID="recDetail_MainImage" runat="server" ImageUrl='<%# Eval("REC_IMAGE") %>' CssClass="RecDetailThumb" />
                    </div>
                    <div class="RecDetail_Row2RHS">
                        <asp:PlaceHolder ID="plc_CurrentRating" runat="server">
                            <div class="recDetail_Stars"><asp:Image ID="RecListStarsImage" runat="server" ImageUrl='<%# getBigBaconStars(Eval("REC_STARS"))%>' ToolTip='<%# "Rated: " & DataBinder.Eval(Container.DataItem, "REC_STARS") & " Bacon Strips" %>' /></div>
                            <div class="recDetail_TimesRated"><asp:Label ID="Label2" runat="server" Text='<%# "Based on " & Eval("REC_STARSTIMES") & " Ratings" %>' /></div>
                        </asp:PlaceHolder>
                        <div class="recDetail_Serves">Serves: <asp:Label ID="Label7" runat="server" Text='<%# Eval("REC_SERVES") %>' /></div>                        
                        <div class="recDetail_Time">Preparation Time: <asp:Label ID="Label6" runat="server" Text='<%# Eval("REC_TIME") %>' /> minutes</div>
                    </div>
                </div>
                <div class="recDetail_AboutContainer">
                    <h2>About This Recipe</h2>
                </div>
                 <div class="recDetail_Desc"><asp:Label ID="Label8" runat="server" Text='<%# Eval("REC_DESC") %>' /></div>
        </SelectedItemTemplate>

    </asp:ListView>


    <asp:SqlDataSource ID="RecFullDetailSqlDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [RECIPE_USER_TYPE_VIEW] WHERE ([REC_ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="REC_ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

<!------ Ingredients Section ------>

    <div class="recDetail_IngredientsContainer">
        <h2>Ingredients</h2>
    </div>
    <asp:ListView ID="lst_Ingredients" runat="server" DataKeyNames="ING_ID" 
        DataSourceID="IngDataSource">

        <AlternatingItemTemplate>
            <div class="recDetail_IngredientsList">
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("ING_QTY") %>' />, <asp:Label ID="ING_DESCLabel" runat="server" Text='<%# Eval("ING_DESC") %>' />
            </div>
        </AlternatingItemTemplate>

        <EditItemTemplate>
            <div class="recDetail_IngredientsList">
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("ING_QTY") %>' />, <asp:Label ID="ING_DESCLabel" runat="server" Text='<%# Eval("ING_DESC") %>' />
            </div>
        </EditItemTemplate>

        <EmptyDataTemplate>
            <div class="noIngredientsAvailable">There are no ingredients available for this recipe</div>
        </EmptyDataTemplate>

        <InsertItemTemplate>
            <div class="recDetail_IngredientsList">
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("ING_QTY") %>' />, <asp:Label ID="ING_DESCLabel" runat="server" Text='<%# Eval("ING_DESC") %>' />
            </div>
        </InsertItemTemplate>

        <ItemTemplate>
            <div class="recDetail_IngredientsList">
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("ING_QTY") %>' />, <asp:Label ID="ING_DESCLabel" runat="server" Text='<%# Eval("ING_DESC") %>' />
            </div>
        </ItemTemplate>

        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>

        <SelectedItemTemplate>
            <div class="recDetail_IngredientsList">
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("ING_QTY") %>' />, <asp:Label ID="ING_DESCLabel" runat="server" Text='<%# Eval("ING_DESC") %>' />
            </div>
        </SelectedItemTemplate>
    </asp:ListView>

    <asp:SqlDataSource ID="IngDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [INGREDIENT] WHERE ([REC_ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="REC_ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <p>&nbsp;</p>
   
<!------ Method Section ------>

    <div class="recDetail_IngredientsContainer">
        <h2>Cooking Instructions</h2>
    </div>

    <ol class="recMethodList">
    <asp:ListView ID="lst_Method" runat="server" DataKeyNames="METHOD_ID" 
        DataSourceID="MethodDataSource">

        <AlternatingItemTemplate>
            <li>
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("METHOD_DESC") %>' />
            </li>
        </AlternatingItemTemplate>

        <EditItemTemplate>
            <li>
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("METHOD_DESC") %>' />
            </li>
        </EditItemTemplate>

        <EmptyDataTemplate>
            <span>There are no cooking instructions available for this recipe</span>
        </EmptyDataTemplate>

        <InsertItemTemplate>
            <li>
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("METHOD_DESC") %>' />
            </li>
        </InsertItemTemplate>

        <ItemTemplate>
            <li>
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("METHOD_DESC") %>' />
            </li>
        </ItemTemplate>

        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>

        <SelectedItemTemplate>
            <li>
                <asp:Label ID="ING_QTYLabel" runat="server" Text='<%# Eval("METHOD_DESC") %>' />
            </li>
        </SelectedItemTemplate>
    </asp:ListView>
    </ol>

    <asp:SqlDataSource ID="MethodDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [METHOD] WHERE ([REC_ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="REC_ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>


<!------ Gallery Section ------>

    <div class="recDetail_RecNameContainer">
        <h2>Photo Gallery</h2>
    </div>

   <div class="recDetail_GalleryContainer">

    <asp:ListView ID="lst_Gallery" runat="server" DataKeyNames="GALLERY_ID" 
        DataSourceID="galleryDataSource">

        <AlternatingItemTemplate>
            <a href='<%# Eval("GALLERY_PATH") %>' rel="prettyPhoto[pp_gal]" class="recDetailGalleryLink"><img src='<%# Eval("GALLERY_PATH") %>' class="recDetailGalleryPhoto" /></a>
        </AlternatingItemTemplate>

        <EditItemTemplate>
            <a href='<%# Eval("GALLERY_PATH") %>' rel="prettyPhoto[pp_gal]" class="recDetailGalleryLink"><img src='<%# Eval("GALLERY_PATH") %>' class="recDetailGalleryPhoto" /></a>
        </EditItemTemplate>

        <EmptyDataTemplate>
            <span>There are no additional photos for this recipe</span>
        </EmptyDataTemplate>

        <InsertItemTemplate>
            <a href='<%# Eval("GALLERY_PATH") %>' rel="prettyPhoto[pp_gal]" class="recDetailGalleryLink"><img src='<%# Eval("GALLERY_PATH") %>' class="recDetailGalleryPhoto" /></a>
        </InsertItemTemplate>

        <ItemTemplate>
            <a href='<%# Eval("GALLERY_PATH") %>' rel="prettyPhoto[pp_gal]" class="recDetailGalleryLink"><img src='<%# Eval("GALLERY_PATH") %>' class="recDetailGalleryPhoto" /></a>
        </ItemTemplate>

        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
        </LayoutTemplate>

        <SelectedItemTemplate>
            <a href='<%# Eval("GALLERY_PATH") %>' rel="prettyPhoto[pp_gal]" class="recDetailGalleryLink"><img src='<%# Eval("GALLERY_PATH") %>' class="recDetailGalleryPhoto" /></a>
        </SelectedItemTemplate>

    </asp:ListView>

    </div>

    <asp:Literal ID="Literal1" runat="server">
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function () {
                $("a[rel^='prettyPhoto']").prettyPhoto();
            });
        </script>
    
    </asp:Literal> 

    <asp:SqlDataSource ID="galleryDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [GALLERY] WHERE ([RECIPE_ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="RECIPE_ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>


<!------ Comments Form ------>

    <div class="recDetail_CommentsContainer">
        <h2>Comments</h2>
    </div>

<!------ Current Comments ------>

    <asp:ListView ID="lst_Comments" runat="server">

        <AlternatingItemTemplate>
         <div class="recDetailCommentCont">
            <div class="recDetailCommentPhoto">
                <img src='<%# Eval("USER_PHOTO") %>' class="recDetailUserPhoto" />
            </div>
            <div class="recDetailCommentDetails">
                <div class="recDetailCommentName">
                    <span class="recDetailCommenterName">
                        <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & Eval("USER_FNAME") %> <%# Eval("USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a> </span> <span class="recDetailCommentDate">| <%# Eval("COMM_DATE") %></span></div>
                <div class="recDetailCommentComment">
                    <%# Eval("COMM_DESC") %>
                </div>
            </div>
        </div>
        </AlternatingItemTemplate>

        <EditItemTemplate>
         <div class="recDetailCommentCont">
            <div class="recDetailCommentPhoto">
                <img src='<%# Eval("USER_PHOTO") %>' class="recDetailUserPhoto" />
            </div>
            <div class="recDetailCommentDetails">
                <div class="recDetailCommentName">
                    <span class="recDetailCommenterName">
                        <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & Eval("USER_FNAME") %> <%# Eval("USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a> </span> <span class="recDetailCommentDate">| <%# Eval("COMM_DATE") %></span></div>
                <div class="recDetailCommentComment">
                    <%# Eval("COMM_DESC") %>
                </div>
            </div>
        </div>
        </EditItemTemplate>

        <EmptyDataTemplate>
            <div class="recNoComments">There are no comments for this recipe</div>
        </EmptyDataTemplate>

        <InsertItemTemplate>
         <div class="recDetailCommentCont">
            <div class="recDetailCommentPhoto">
                <img src='<%# Eval("USER_PHOTO") %>' class="recDetailUserPhoto" />
            </div>
            <div class="recDetailCommentDetails">
                <div class="recDetailCommentName">
                    <span class="recDetailCommenterName">
                        <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & Eval("USER_FNAME") %> <%# Eval("USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a> </span> <span class="recDetailCommentDate">| <%# Eval("COMM_DATE") %></span></div>
                <div class="recDetailCommentComment">
                    <%# Eval("COMM_DESC") %>
                </div>
            </div>
        </div>
        </InsertItemTemplate>

        <ItemTemplate>
         <div class="recDetailCommentCont">
            <div class="recDetailCommentPhoto">
                <img src='<%# Eval("USER_PHOTO") %>' class="recDetailUserPhoto" />
            </div>
            <div class="recDetailCommentDetails">
                <div class="recDetailCommentName">
                    <span class="recDetailCommenterName">
                        <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & Eval("USER_FNAME") %> <%# Eval("USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a> </span> <span class="recDetailCommentDate">| <%# Eval("COMM_DATE") %></span></div>
                <div class="recDetailCommentComment">
                    <%# Eval("COMM_DESC") %>
                </div>
            </div>
        </div>
        </ItemTemplate>

        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>

        <SelectedItemTemplate>
         <div class="recDetailCommentCont">
            <div class="recDetailCommentPhoto">
                <img src='<%# Eval("USER_PHOTO") %>' class="recDetailUserPhoto" />
            </div>
            <div class="recDetailCommentDetails">
                <div class="recDetailCommentName">
                    <span class="recDetailCommenterName">
                        <a href='<%# "Profile.aspx?User=" & DataBinder.Eval(Container.DataItem, "USER_UNAME") %>' title='<%# "View " & Eval("USER_FNAME") %> <%# Eval("USER_LNAME") & "&#39s Profile" %>'><asp:Label ID="Label9" runat="server" Text='<%# Eval("USER_FNAME") %>' /> <asp:Label ID="Label10" runat="server" Text='<%# Eval("USER_LNAME") %>' /></a> </span> <span class="recDetailCommentDate">| <%# Eval("COMM_DATE") %></span></div>
                <div class="recDetailCommentComment">
                    <%# Eval("COMM_DESC") %>
                </div>
            </div>
        </div>
        </SelectedItemTemplate>

    </asp:ListView>

        <asp:SqlDataSource ID="ProfileCommentsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [PROFILE_COMMENT_VIEW] WHERE ([REC_ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="REC_ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
    </asp:SqlDataSource>

    <!-- Login to comment notice - only visible to normal users - not visible if user is logged in -->
    <asp:PlaceHolder ID="ph_CommentLogin" runat="server">
    <p class="RecDetailLoginToComment">
        Please <a href="Account/Login.aspx">Log In</a> or <a href="Account/Register.aspx">Register</a> to be able to comment on this recipe
    </p>
    </asp:PlaceHolder>
    <p class="RecDetailBlockedComment">
    <asp:Label ID="lbl_NotAllowedToComment" runat="server" Text="Label" CssClass="val_frmTable">You are not allowed to comment on this recipe because you have been blocked by an admin</asp:Label>
    </p>

    <!-- Comments form - only visible to registered users -->
    <asp:PlaceHolder ID="ph_CommentForm" runat="server">
    <table cellpadding="0" cellspacing="0" id="recDetailCommentForm" class="frmTable">
        <tr>
            <td> 
                <asp:Image ID="commentFormPhoto" runat="server" /></td>
            <td class="inp_frmTable">
                <asp:TextBox ID="tb_CommComment" runat="server" CssClass="textEntry" TextMode="MultiLine"></asp:TextBox></td>
        </tr>
        <tr>
            <td> </td>
            <td>
                <asp:Button ID="btn_AddComment" runat="server" Text="Add Comment"  CssClass="btn_Form" style="margin-top:0px;"  /></td>
        </tr>
    </table>  
    </asp:PlaceHolder>

</div>

    <div id="rhsPaneNarrow" style="margin-top:80px;">
        <div class="adContainer">
            <div class="icnContainer">
                <img src="/ui/icnRSSFeed.gif" /></div>
            <div class="txtContainer">
                <p class="headerCont">
                    Never Miss A Greasy Recipe!</p>
                <p class="normalCont">
                    <a href="/RSS.aspx">Subscribe To Our RSS Feed!</a></p>
            </div>
        </div>
        <div class="sideBarList">
            <div class="sideImage">
               <img src="/ui/imgSideBacon.jpg" />
            </div>
            <div class="sideBarHeader">
            <h2>Our Most Viewed Recipes<br />
            <span>...all bursting with Bacon Goodness!</span></h2>
            </div>
            <asp:GridView ID="grd_sideTopRecipesViewed" runat="server" AutoGenerateColumns="False"
                DataSourceID="statRecipeNumViewsSqlDataSource" CssClass="grd_profileRecipeStyle"
                AllowPaging="False">
                <Columns>
                    <asp:TemplateField HeaderText="Record Number">
                        <ItemTemplate>
                            <%# Container.DataItemIndex + 1 %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Recipe">
                        <ItemTemplate>
                            <div>
                                <a href='<%# DataBinder.Eval(Container.DataItem, "RECIPE_ID", "RecipeDetail.aspx?ID={0}") %>'>
                                    <%# DataBinder.Eval(Container.DataItem, "REC_NAME") %></a></div>
                        </ItemTemplate>
                        <ControlStyle CssClass="EightyWidth" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="notVis" />
            </asp:GridView>
            <asp:SqlDataSource ID="statRecipeNumViewsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>"
                ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" SelectCommand="SELECT TOP 10 * FROM [STAT_RECIPE_NUMVIEWS_VIEW]">
            </asp:SqlDataSource>
        </div>
        <div class="sideBarList">
            <div class="sideImage">
                <img src="/ui/icnBaconLove.jpg" style="margin-left:20px;" />
            </div>
            <div class="sideBarHeader">
                <h2>
                    Our Top 5 Contributors<br />
                    <span>...sharing Bacon Love!</span></h2>
            </div>
            <asp:GridView ID="grd_StatTopUsersRecipes" runat="server" AutoGenerateColumns="False"
                DataSourceID="StatUserNumRecipesSqlDataSource" CssClass="grd_profileRecipeStyle"
                AllowPaging="True">
                <Columns>
                    <asp:TemplateField HeaderText="Record Number">
                        <ItemTemplate>
                            <%# Container.DataItemIndex + 1 %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="User">
                        <ItemTemplate>
                            <div style="width: 200px;">
                                <a href='<%# DataBinder.Eval(Container.DataItem, "USER_UNAME", "Profile.aspx?User={0}") %>'>
                                    <%# DataBinder.Eval(Container.DataItem, "USER_FNAME")%>
                                    <%# DataBinder.Eval(Container.DataItem, "USER_LNAME")%></a></div>
                        </ItemTemplate>
                        <ControlStyle CssClass="EightyWidth" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="User">
                        <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "NumRecipes") & " recipes" %>
                        </ItemTemplate>
                        <ControlStyle CssClass="EightyWidth" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="notVis" />
            </asp:GridView>
            <asp:SqlDataSource ID="StatUserNumRecipesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>"
                ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" SelectCommand="SELECT TOP 5 * FROM [NUM_RECIPE_VIEW]">
            </asp:SqlDataSource>
        </div>
    </div>
</asp:Content>
